package com.wantong.jianpu.adapters;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.BaseLoadMoreModule;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.wantong.jianpu.R;
import com.wantong.jianpu.beans.MessageBean;

/**
 * @author PACY
 * @date 2022/4/24
 * description:
 */
public class MessageAdapter extends BaseQuickAdapter<MessageBean.RowsDTO, BaseViewHolder> implements LoadMoreModule {
    public MessageAdapter() {
        super(R.layout.message_item_view);
    }

    @Override
    protected void convert(BaseViewHolder holder, MessageBean.RowsDTO s) {
        holder.setText(R.id.content_tv,s.getTitle())
                .setVisible(R.id.msg_tv,s.getIsReceived().equals("0"))
                .setText(R.id.time_tv,s.getSendTime());
    }

    @Override
    public BaseLoadMoreModule addLoadMoreModule(BaseQuickAdapter<?, ?> baseQuickAdapter) {
        return new BaseLoadMoreModule(baseQuickAdapter);
    }
}
